package demo4;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2024-06-18
 * Time: 16:22
 */

interface IA{
    void testA();
}

interface IB {
    void testB();
}

interface IC extends IA,IB{
    void testC();
}

class ID implements IC{

    @Override
    public void testA() {

    }

    @Override
    public void testB() {

    }

    @Override
    public void testC() {

    }
}
public class Test {
    public static void walk(IRunning iRunning){
        iRunning.run();
    }

    public static void fly(IFly iFly){
        iFly.fly();
    }

    public static void swim(ISwimming iSwimming){
        iSwimming.swim();
    }

    public static void main2(String[] args) {
        walk(new Duck("唐老鸭", 31));
        walk(new Dog("旺财", 7));

        fly(new Duck("唐老鸭", 31));
        walk(new Robot());
    }

    public static void main1(String[] args) {
        Animal animal1 = new Dog("大黄", 5);
        animal1.eat();
        ((Dog) animal1).run();
        ((Dog) animal1).swim();
    }

    public static void main(String[] args) {
        Dog dog1 = new Dog("旺财", 11);
        Dog dog2 = new Dog("旺财", 11);
        //System.out.println(dog1 ==dog2);
        //System.out.println(dog1.equals(dog2));

        System.out.println(dog1.hashCode());
        System.out.println(dog2.hashCode());
    }

}
